﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace app2
{
    public class MyBoll
    {
        public int x;
        public int y;
        public int d;
        public int clientwidth;
        public int clientheight;
        private int mx;
        private int my;
        public MyBoll() { }
        public MyBoll(int clientwidth, int clientheight)
        {
            this.clientheight = clientheight;
            this.clientwidth = clientwidth;
            this.x = clientwidth / 2;
            this.y = clientheight / 2;
            this.d = 20;
            this.mx = 3;
            this.my = 3;
        }

        public void Up()
        {
            if (y > 0)
                y -= my;
        }
        public void Down()
        {
            if (y < this.clientheight - this.d)
                y += my;
        }
        public void Left()
        {
            if (x > 0)
                x -= mx;
        }
        public void Right()
        {
            if (x < this.clientwidth - this.d)
                x += mx;
        }
    }
}
